package com.jy.adscm.operation.cg.controller;


import com.jy.adscm.exception.AdscmSystemException;
import com.jy.adscm.operation.cg.bean.CgBomAndDate;
import com.jy.adscm.operation.cg.bean.MachineProcess;
import com.jy.adscm.operation.cg.bean.QueryCondition;
import com.jy.adscm.operation.cg.service.CgBomAndDateService;
import com.jy.adscm.operation.cg.service.MachineProcessService;
import com.jy.adscm.support.SimpleCoreResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zyl
 * @since 2019-07-17
 */
@RestController
@RequestMapping("adscm/operation/cg/cgBomAndDate")
public class CgBomAndDateController {
    @Autowired
    CgBomAndDateService cgBomAndDateService;

    @RequestMapping("create")
    public SimpleCoreResponse create(@RequestBody QueryCondition queryCondition, HttpServletRequest request) throws AdscmSystemException {
        boolean   result= cgBomAndDateService.create(queryCondition);
        return  new SimpleCoreResponse("200","查询成功",result);
    }
    @RequestMapping("select/{makeNo}")
    public SimpleCoreResponse select(@PathVariable String makeNo, HttpServletRequest request) throws AdscmSystemException {
        HashMap<String,List<CgBomAndDate>>   cgBomAndDates = cgBomAndDateService.select(makeNo);
        return  new SimpleCoreResponse("200","查询成功",cgBomAndDates);
    }
}

